package yelmor.comm100;

import org.igniterealtime.restclient.entity.UserEntities;
import org.igniterealtime.restclient.entity.UserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import yelmor.comm100.domain.CoUser;
import yelmor.comm100.domain.CoUserRole;
import yelmor.comm100.domain.OfMessageArchive;
import yelmor.comm100.repository.CoUserRepository;
import yelmor.comm100.repository.CoUserRoleRepository;
import yelmor.comm100.bean.OpenfireApi;
import yelmor.comm100.repository.OfMessageArchiveRepository;

import java.io.File;
import java.util.*;

/**
 * Created by yel on 4/14/16.
 */
@SpringBootApplication
public class Application /*extends SpringBootServletInitializer*/ implements CommandLineRunner {
//  Logger log = LoggerFactory.getLogger(Application.class);

  public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
  }

  @Autowired
  private CoUserRepository coUserRepository;

  @Autowired
  private CoUserRoleRepository coUserRoleRepository;

  @Autowired
  private OpenfireApi openfireApi;

  /*@Autowired
  public void setCoUserRepository(CoUserRepository coUserRepository) {
      this.coUserRepository = coUserRepository;
  }*/
/*  @Override
  protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    return application.sources(Application.class);
  }*/

  @Autowired
  private OfMessageArchiveRepository ofMessageArchiveRepository;

  @Override
  public void run(String... args) throws Exception {
    new File("tmp").mkdir();
  }
}
